package com.lapian.designmode.flyweight;

import java.util.HashMap;

public class WebsiteFactory {

    private HashMap<String,ConcreteWebsite> pool=new HashMap<>();
    public Website getWebSiteCategory(String type) {
        if (!pool.containsKey(type)){
            pool.put(type,new ConcreteWebsite(type));
        }
        return (Website) pool.get(type);
    }
    public int getWebsiteCount(){
        return pool.size();
    }
}
